const {
  DataTypes
} = require('sequelize');

module.exports = sequelize => {
  const attributes = {
    adv_id: {
      type: DataTypes.INTEGER(11),
      allowNull: false,
      defaultValue: null,
      primaryKey: true,
      autoIncrement: true,
      comment: "id",
      field: "adv_id",
      unique: "adv_id"
    },
    user_id: {
      type: DataTypes.INTEGER(11),
      allowNull: false,
      defaultValue: null,
      primaryKey: false,
      autoIncrement: false,
      comment: "委托人id",
      field: "user_id"
    },
    accept_user_id: {
      type: DataTypes.INTEGER(11),
      allowNull: false,
      defaultValue: null,
      primaryKey: false,
      autoIncrement: false,
      comment: "接受委托者id",
      field: "accept_user_id"
    },
    ent_id: {
      type: DataTypes.INTEGER(11),
      allowNull: false,
      defaultValue: null,
      primaryKey: false,
      autoIncrement: false,
      comment: "委托id",
      field: "ent_id"
    },
    progress: {
      type: DataTypes.INTEGER(11),
      allowNull: false,
      defaultValue: "0",
      primaryKey: false,
      autoIncrement: false,
      comment: "进度",
      field: "progress"
    },
    ent_path: {
      type: DataTypes.STRING(255),
      allowNull: true,
      defaultValue: null,
      primaryKey: false,
      autoIncrement: false,
      comment: "已上传程序路径",
      field: "ent_path"
    },
    creation_time: {
      type: DataTypes.DATE,
      allowNull: true,
      defaultValue: sequelize.literal('CURRENT_TIMESTAMP'),
      primaryKey: false,
      autoIncrement: false,
      comment: "创建时间",
      field: "creation_time"
    },
    update_time: {
      type: DataTypes.DATE,
      allowNull: true,
      defaultValue: sequelize.literal('CURRENT_TIMESTAMP'),
      primaryKey: false,
      autoIncrement: false,
      comment: "最近一次修改时间",
      field: "update_time"
    },
    is_delete: {
      type: DataTypes.INTEGER(1),
      allowNull: true,
      defaultValue: "0",
      primaryKey: false,
      autoIncrement: false,
      comment: "是否删除",
      field: "is_delete"
    }
  };
  const options = {
    tableName: "ent_advances",
    comment: "",
    indexes: []
  };
  const EntAdvancesModel = sequelize.define("ent_advances_model", attributes, options);
  return EntAdvancesModel;
};